﻿namespace Service.CAP.EventBus
{
    public interface IEventPublisher
    {

        Task PublishDelayAsync<T>(TimeSpan timeSpan, T eventObj, string callbackName = null, CancellationToken cancellationToken = default(CancellationToken))
where T : IEvent;

        Task PublishDelayAsync<T>(TimeSpan timeSpan, T eventObj, IDictionary<string, string> headers, CancellationToken cancellationToken = default(CancellationToken))
   where T : IEvent;

        Task PublishAsync<T>(T eventObj, string callbackName = null, CancellationToken cancellationToken = default(CancellationToken))
           where T : IEvent;

        Task PublishAsync<T>(T eventObj, IDictionary<string, string> headers, CancellationToken cancellationToken = default(CancellationToken))
           where T : IEvent;

        void Publish<T>(T eventObj, string callbackName = null)
           where T : IEvent;

        void Publish<T>(T eventObj, IDictionary<string, string> headers)
           where T : IEvent;
    }
}
